package com.example.CarManagement;

import at.favre.lib.crypto.bcrypt.BCrypt;
import cn.hutool.core.util.StrUtil;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import org.springframework.security.crypto.password.PasswordEncoder;

import javax.annotation.Resource;

public class passwordDemo {


    @Test
    public void test() {
        // 原始密码
        String rawPassword = "123456";
        BCryptPasswordEncoder bCryptPasswordEncoder = new BCryptPasswordEncoder();

        String rw = bCryptPasswordEncoder.encode(rawPassword);
        System.out.println(rw);
        System.out.println(bCryptPasswordEncoder.matches(rawPassword, rw));

    }

}
